package com.ccdt.tv.smartrecommend.model.http;


import com.ccdt.tv.smartrecommend.model.bean.ResponseBean;

import rx.Observable;
import rx.schedulers.Schedulers;

/**
 * Created width Android Studio
 * User:StormSun
 * Date:2017/1/13
 * Time:15:29
 * Description:
 */
public class Api extends BaseApi {

    private static Api mInstance;
    private ApiService mService;

    private Api() {
        mService = getRetrofit().create(ApiService.class);
    }

    public static Api getInstance() {
        if (mInstance == null) {
            synchronized (Api.class) {
                if (mInstance == null) {
                    mInstance = new Api();
                }
            }
        }
        return mInstance;
    }

    public Observable<ResponseBean> getLiveRecommend(String caId, String areaCode, String serviceId){
        return mService.getLiveRecommend(caId,areaCode,serviceId).subscribeOn(Schedulers.io());
    }
    public Observable<ResponseBean> getHitChannels(String caId, String areaCode, String serviceId){
        return mService.gethitChannels(caId,areaCode,serviceId).subscribeOn(Schedulers.io());
    }
}
